One known technique for improving performance of a data processing apparatus is to provide circuitry to support execution of vector operations. Vector operations are performed on at least one vector operand, where each vector operand comprises a plurality of vector elements. Performance of the vector operation then involves applying an operation repetitively across the various vector elements within the vector operand(s). In typical data processing systems that support performance of vector operations, a vector register file is be provided for storing the vector operands. Through the use of vector operations, significant performance benefits can be realised when compared with the performance of an equivalent series of scalar operations.
One known type of vector operation is a vector scan operation, where a predetermined combination operation is applied repetitively to an increasing number of data elements. The combination operation can take a variety of forms, such as an add operation, multiply operation, minimum selection operation, maximum selection operation, etc. As a result of performance of the vector scan operation, a sequence of results is generated, with each result relating to the application of the combination operation to a different number of the data elements. As a particular example, the scan operation may specify an add operation as the combination operation, and such a scan add operation is sometime referred to as a prefix sum operation. Considering an input sequence of numbers x0, x1, x2, . . . application of the scan add operation produces a sequence of results y0, y1, y2, . . . , where:y0=x0 y1=x0+x1 y2=x0+x1+x2,and so on for further results.
In some examples of the vector scan operation, an additional data element S may be combined with the vector data element V of the source vector, to produce a series of results (in the case of a scan add operation):y0=S+x0 y1=S+x0+x1 y2=S+x0+x1+x1,and so on for further results.
The present technique seeks to provide an improved apparatus and method for carrying out such a vector scan operation.